package order.application.service;

import order.domain.model.Address;
import order.domain.repository.AddressRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AddressService {

    @Autowired
    private AddressRepository addressRepository;

    public void save(Address address) {
        addressRepository.save(address);
    }

    public Address getByOrderId(Long orderId) {
        return addressRepository.findByOrderId(orderId);
    }
}